﻿#region Librerias

using System;
using System.Web;
using System.Web.Services;
using ESF.General;

#endregion


/// <summary>
/// Summary description for ErrorLogger
/// </summary>
[WebService(Namespace = "http://esf.net/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
// [System.Web.Script.Services.ScriptService]
public class ErrorLogger : System.Web.Services.WebService 
{
	#region Constructor

    public ErrorLogger () 
	{
	    //Uncomment the following line if using designed components 
        //InitializeComponent(); 
    }

	#endregion


	#region Funciones

	[WebMethod]
    public void LogError (ErrorReport pErrorReport) 
	{
		try
		{
			pErrorReport.RemoteMachineAddress = HttpContext.Current.Request.UserHostAddress;

			AdoGeneral.InsertError (pErrorReport);
		}
		catch (Exception ex)
		{
			throw Log.ErrorWS (ex);
		}
	}

	#endregion
}
